function $(s){	return document.getElementById(s);	}
	function $$(s){	return $(s).value;	}
	
	function formatDate(){
		var o	= $("hh");
		o.value	= $$("my")+"-"+format($$("mm"))+"-"+format($$("md"));
	}
	
	function format(d){
		return	parseInt(d)<10 ? "0"+d : d;
	}
	
	function loadYear(o){
		if(o.options.length <=1 ){
			//var len	= (new Date()).getYear();
			//if(len < 1900){
			//	len	=len + 1900;
			//}
			var	count=0;
			for(var i=1999; i>=1900; i--){
				o.options[count]	= new Option(""+i,""+i);
				count	= count +1;
			}
		}
	}
	
	function loadMonth(o){
		if(o.options.length <=1 ){
			for(var i=0; i<12; i++){
				o.options[i]	= new Option(i+1,i+1);
			}
		}
	}
	
	function loadDate(y,m,o){
		var   intCount=o.length;
		var	len	= MonthLength(y.value,m.value);
		if(intCount <= 1){
			for(var i=0; i<len; i++){
				o.options[i]	= new Option(i+1,i+1);
			}
		}
		if(intCount>1 && intCount != len){
			for(i=0;i<intCount;i++){
				o.remove(i);
			}
			for(var i=0; i<len; i++){
				o.options[i]	= new Option(i+1,i+1);
			}
		}
	}
	
	function MonthLength(y,m){
		var days	= new Array(31,28,31,30,31,30,31,31,30,31,30,31);
		if( parseInt(m) == 2){
			var y	= parseInt(y);
			return (((y%4==0) && (y%100!=0)) || (y%400==0)) ? 29 : days[ parseInt(m)-1 ]; 
		}else{
			return days[ parseInt(m)-1 ];
		}
	}